package com.gusti.turnos.model;

import java.util.Set;

import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;

/**
 * 
 * @author gusti
 *
 */
@Entity
@DiscriminatorValue( "birthday" )
public class BirthdayEvent extends Event {

	private static final long serialVersionUID = 2552024897879962358L;

	//PROPERTIES
	private String description;

	@ManyToMany(cascade=CascadeType.ALL)
	@JoinTable(name="birthday_event_waiter_user", joinColumns=@JoinColumn(name="birthdayEventId"), inverseJoinColumns=@JoinColumn(name="waiterUserId"))
	@Basic(optional=false)
	private Set<User> waiters;

	//MODIFIERS
	@Basic(optional=false)
	@Column(nullable=false)
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}

	public Set<User> getWaiters() {
		return waiters;
	}
	public void setWaiters(Set<User> waiters) {
		this.waiters = waiters;
	}

	//OTHERS
}
